/*
 * iobuffer.cpp
 *
 *  Created on: 2016-4-2
 *      Author: ZhangXiyin
 */

#include "iobuffer.h"
#include "gc/gc.h"

namespace eyas {
namespace buffer {

iobuffer::iobuffer():writer_(*this), reader_(*this), length_(0){
}
iobuffer::iobuffer(iobuffer& buffer)
:writer_(*this), reader_(*this), bufferPtr_(buffer.bufferPtr_), length_(0){
}
iobuffer::iobuffer(const iobuffer& buffer)
:writer_(*this), reader_(*this), bufferPtr_(buffer.bufferPtr_), length_(0){

}
#ifdef EYAS_ENABLE_C11
iobuffer::iobuffer(EYAS_BUFFER_RV_REF(iobuffer) buffer)
:writer_(*this), reader_(*this), bufferPtr_(buffer.bufferPtr_), length_(0){
	buffer.free();
	buffer.bufferPtr_ = nullptr;
}
#endif
iobuffer::~iobuffer() {
	bufferPtr_.reset();
}
void iobuffer::free(){
	if(nullptr != bufferPtr_){
		bufferPtr_.reset();
	}
}
void iobuffer::init(){
}

} /* namespace thread */
} /* namespace eyas */
